package top.riske.gen3d.entity;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 3D任务状态
 * WAIT：等待中，RUN：执行中，FAIL：任务失败，DONE：任务成功
 */
@Getter
@ToString
public enum Hunyuan3DJobStatus {

    WAIT(0,"WAIT", "等待中"),
    RUN(1,"RUN", "执行中"),
    FAIL(2,"FAIL", "任务失败"),
    DONE(3,"DONE", "任务成功");

    private final int code;

    private final String status;

    private final String message;

    Hunyuan3DJobStatus(int code, String status, String message) {
        this.code = code;
        this.status = status;
        this.message = message;
    }

    /**
     * 根据code获取枚举
     * @param code 枚举code
     * @return 枚举
     */
    public static Hunyuan3DJobStatus getByCode(int code) {
        for (Hunyuan3DJobStatus value : Hunyuan3DJobStatus.values()) {
            if (value.code == code) {
                return value;
            }
        }
        return null;
    }


}
